import java.util.ArrayList;

public class Text {
    public static void main(String[] args) {
        Graphic[] graphics = {
                new Circle(10),
                new Square(10),
                new Square(20),
                new Triangle(10,10,10),
                new Triangle(10,10,15)
        };
        double sumPeri = 0, sumArea = 0;
        for (int i = 0; i < graphics.length; i++) {
            System.out.println(graphics[i].getMessage());
            sumPeri += graphics[i].getPeri();
            sumArea += graphics[i].getAera();
        }
        System.out.println("面积和：" + sumArea);
        System.out.println("周长和：" + sumPeri);
    }
}
